/**
 * 
 */
package com.gametime.model;

/**
 * @author dave
 *
 */
public class Person {
	
	private int id;
	private String firstName;
	private String lastName;
	private String name;
	private int height;
	private int weight;
	
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	/**
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * @param height the height to set
	 */
	public void setHeight(int height) {
		this.height = height;
	}
	/**
	 * @param weight the weight to set
	 */
	public void setWeight(int weight) {
		this.weight = weight;
	}
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}
	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		if(name == null && isComplete())
			name = firstName +  " " + lastName;
		return name;
	}
	
	private boolean isComplete()
	{
		if(firstName != null && lastName != null)
			return true;
		else
			return false;
	}
	
	public String formatHeight(int hgt)
	{
		int _a = hgt / 12;
		int _b = hgt % 12;
		return _a + "-"  +_b;
		
	}
	
	public String toString()
	{
		return "<Person id='" + this.id + "' " +
						"firstName='" + this.firstName + "' "+ 
						"lastName='" + this.lastName + "' "+ 
						"height='" + formatHeight(this.height) + "' weight='"+ this.weight+"' />" ;
	}
	public int getHeight() {
		// TODO Auto-generated method stub
		return this.height;
	}
	
	public int getWeight() {
		// TODO Auto-generated method stub
		return weight;
	}
	

}
